package com.dw.entity;

import com.dw.dao.ProjectDao;

public class Goal {
	private String id;
	private String name;
	private String desc;
	private String createtime;
	private String projectID;
	private Project p;
	private float rate;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	public String getProjectID() {
		return projectID;
	}
	public void setProjectID(String projectID) {
		this.projectID = projectID;
		setP(new ProjectDao().findByID(projectID));
	}
	
	public Project getP() {
		return p;
	}
	private void setP(Project p) {
		this.p = p;
	}
	public float getRate() {
		return rate;
	}
	public void setRate(float rate) {
		if(rate>100){
			this.rate=100;
		}else if(rate<0){
			this.rate=0;
		}else{
			this.rate = rate;
		}
	}
	
	
	
}
